home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Hardware / PowerManager DDK 1.0f1 / Interfaces&Libraries / Interfaces / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-08  |  7.1 KB  |  224 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    Interfaces for create native drivers NDRV
  5.  
  6.      Version:    
  7.  
  8.      DRI:        Pradeep Kathail
  9.  
  10.      Copyright:    © 1995-1999 by Apple Computer, Inc., all rights reserved.
  11.  
  12.      Warning:    *** APPLE INTERNAL USE ONLY ***
  13.                  This file may contain unreleased API's
  14.  
  15.      BuildInfo:    Built by:            Scott Johnson
  16.                  On:                    10/8/99 11:26 AM
  17.                  With Interfacer:    3.0d13   (MPW PowerPC)
  18.                  From:                DriverFamilyMatching.i
  19.                      Revision:        30
  20.                      Dated:            5/8/99
  21.                      Last change by:    tjc
  22.                      Last comment:    This file reverts back to <26>. All Power budgeting stuff moved
  23.  
  24.      Bugs:        Report bugs to Radar component "System Interfaces", "Latest"
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __DRIVERFAMILYMATCHING__
  29. #define __DRIVERFAMILYMATCHING__
  30.  
  31. #ifndef __MACTYPES__
  32. #include <MacTypes.h>
  33. #endif
  34.  
  35. #ifndef __NAMEREGISTRY__
  36. #include <NameRegistry.h>
  37. #endif
  38.  
  39. #ifndef __CODEFRAGMENTS__
  40. #include <CodeFragments.h>
  41. #endif
  42.  
  43.  
  44.  
  45.  
  46. #if PRAGMA_ONCE
  47. #pragma once
  48. #endif
  49.  
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53.  
  54. #if PRAGMA_IMPORT
  55. #pragma import on
  56. #endif
  57.  
  58. #if PRAGMA_STRUCT_ALIGN
  59.     #pragma options align=mac68k
  60. #elif PRAGMA_STRUCT_PACKPUSH
  61.     #pragma pack(push, 2)
  62. #elif PRAGMA_STRUCT_PACK
  63.     #pragma pack(2)
  64. #endif
  65.  
  66. /*
  67.   ##############################################
  68.    Well known properties in the Name Registry
  69.   ##############################################
  70. */
  71.  
  72. #define kPropertyName                    "name"
  73. #define kPropertyCompatible                "compatible"
  74. #define    kPropertyDriverPtr                "driver-ptr"
  75. #define kPropertyDriverDesc                "driver-description"
  76. #define kPropertyReg                    "reg"
  77. #define kPropertyAAPLAddress            "AAPL,address"
  78. #define kPropertyMatching                "matching"
  79. #define kPropertyAAPLDriverName            "AAPL,driver-name"
  80.  
  81. /* CPassThru */
  82. /*
  83.   #########################################################
  84.    Descriptor for Drivers and NDRVs
  85.   #########################################################
  86. */
  87. /* 
  88.     QuickTime 3.0: "DriverType" has a name collision with cross-platform code.
  89.     Use Mac prefix to avoid collision 
  90. */
  91. /* Driver Typing Information Used to Match Drivers With Devices */
  92.  
  93. struct MacDriverType {
  94.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  95.     NumVersion                         version;                    /* Driver Version Number*/
  96. };
  97. typedef struct MacDriverType            MacDriverType;
  98. #if TARGET_OS_MAC
  99.  
  100. typedef MacDriverType                     DriverType;
  101. #endif  /* TARGET_OS_MAC */
  102.  
  103. typedef MacDriverType *                    DriverTypePtr;
  104. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  105. typedef OptionBits                         RuntimeOptions;
  106. enum {
  107.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  108.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  109.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  110.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  111.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  112.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  113.     kDriverIsForVirtualDevice    = 0x00000040,                    /* Driver is for a virtual Device */
  114.     kDriverSupportDMSuspendAndResume = 0x00000080                /* Driver supports Device Manager Suspend and Resume command */
  115. };
  116.  
  117.  
  118. struct DriverOSRuntime {
  119.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  120.     Str31                             driverName;                    /* Driver's name to the OS*/
  121.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  122. };
  123. typedef struct DriverOSRuntime            DriverOSRuntime;
  124. typedef DriverOSRuntime *                DriverOSRuntimePtr;
  125. /* OS Service Information Used To Declare What APIs a Driver Supports */
  126.  
  127. typedef UInt32                             ServiceCount;
  128.  
  129. struct DriverServiceInfo {
  130.     OSType                             serviceCategory;            /* Service Category Name*/
  131.     OSType                             serviceType;                /* Type within Category*/
  132.     NumVersion                         serviceVersion;                /* Version of service*/
  133. };
  134. typedef struct DriverServiceInfo        DriverServiceInfo;
  135. typedef DriverServiceInfo *                DriverServiceInfoPtr;
  136.  
  137. struct DriverOSService {
  138.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  139.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  140. };
  141. typedef struct DriverOSService            DriverOSService;
  142. typedef DriverOSService *                DriverOSServicePtr;
  143. /* Categories */
  144. enum {
  145.     kServiceCategoryDisplay        = FOUR_CHAR_CODE('disp'),        /* Display Manager*/
  146.     kServiceCategoryOpenTransport = FOUR_CHAR_CODE('otan'),        /* Open Transport*/
  147.     kServiceCategoryBlockStorage = FOUR_CHAR_CODE('blok'),        /* Block Storage*/
  148.     kServiceCategoryNdrvDriver    = FOUR_CHAR_CODE('ndrv'),        /* Generic Native Driver*/
  149.     kServiceCategoryScsiSIM        = FOUR_CHAR_CODE('scsi'),        /* SCSI */
  150.     kServiceCategoryFileManager    = FOUR_CHAR_CODE('file'),        /* File Manager */
  151.     kServiceCategoryIDE            = FOUR_CHAR_CODE('ide-'),        /* ide */
  152.     kServiceCategoryADB            = FOUR_CHAR_CODE('adb-'),        /* adb */
  153.     kServiceCategoryPCI            = FOUR_CHAR_CODE('pci-'),        /* pci bus */
  154.                                                                 /* Nu Bus */
  155.     kServiceCategoryDFM            = FOUR_CHAR_CODE('dfm-'),        /* DFM */
  156.     kServiceCategoryMotherBoard    = FOUR_CHAR_CODE('mrbd'),        /* mother Board */
  157.     kServiceCategoryKeyboard    = FOUR_CHAR_CODE('kybd'),        /* Keyboard */
  158.     kServiceCategoryPointing    = FOUR_CHAR_CODE('poit'),        /* Pointing */
  159.     kServiceCategoryRTC            = FOUR_CHAR_CODE('rtc-'),        /* RTC */
  160.     kServiceCategoryNVRAM        = FOUR_CHAR_CODE('nram'),        /* NVRAM */
  161.     kServiceCategorySound        = FOUR_CHAR_CODE('sond'),        /* Sound (1/3/96 MCS) */
  162.     kServiceCategoryPowerMgt    = FOUR_CHAR_CODE('pgmt'),        /* Power Management */
  163.     kServiceCategoryGeneric        = FOUR_CHAR_CODE('genr')        /* Generic Service Category to receive general Events */
  164. };
  165.  
  166. /* Ndrv ServiceCategory Types */
  167. enum {
  168.     kNdrvTypeIsGeneric            = FOUR_CHAR_CODE('genr'),        /* generic*/
  169.     kNdrvTypeIsVideo            = FOUR_CHAR_CODE('vido'),        /* video*/
  170.     kNdrvTypeIsBlockStorage        = FOUR_CHAR_CODE('blok'),        /* block storage*/
  171.     kNdrvTypeIsNetworking        = FOUR_CHAR_CODE('netw'),        /* networking*/
  172.     kNdrvTypeIsSerial            = FOUR_CHAR_CODE('serl'),        /* serial*/
  173.     kNdrvTypeIsParallel            = FOUR_CHAR_CODE('parl'),        /* parallel */
  174.     kNdrvTypeIsSound            = FOUR_CHAR_CODE('sond'),        /* sound*/
  175.     kNdrvTypeIsBusBridge        = FOUR_CHAR_CODE('brdg')
  176. };
  177.  
  178.  
  179. typedef UInt32                             DriverDescVersion;
  180. /*    The Driver Description */
  181. enum {
  182.     kTheDescriptionSignature    = FOUR_CHAR_CODE('mtej'),
  183.     kDriverDescriptionSignature    = FOUR_CHAR_CODE('pdes')
  184. };
  185.  
  186. enum {
  187.     kInitialDriverDescriptor    = 0,
  188.     kVersionOneDriverDescriptor    = 1
  189. };
  190.  
  191.  
  192. struct DriverDescription {
  193.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  194.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  195.     MacDriverType                     driverType;                    /* Type of Driver*/
  196.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  197.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  198. };
  199. typedef struct DriverDescription        DriverDescription;
  200. typedef DriverDescription *                DriverDescriptionPtr;
  201.  
  202.  
  203.  
  204. #if PRAGMA_STRUCT_ALIGN
  205.     #pragma options align=reset
  206. #elif PRAGMA_STRUCT_PACKPUSH
  207.     #pragma pack(pop)
  208. #elif PRAGMA_STRUCT_PACK
  209.     #pragma pack()
  210. #endif
  211.  
  212. #ifdef PRAGMA_IMPORT_OFF
  213. #pragma import off
  214. #elif PRAGMA_IMPORT
  215. #pragma import reset
  216. #endif
  217.  
  218. #ifdef __cplusplus
  219. }
  220. #endif
  221.  
  222. #endif /* __DRIVERFAMILYMATCHING__ */
  223.  
  224.